home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / Demos_Files / OLE_Automation / frmTrain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-03-08  |  3.4 KB  |  105 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTrain 
  3.    Caption         =   "Train Network"
  4.    ClientHeight    =   2040
  5.    ClientLeft      =   9192
  6.    ClientTop       =   3252
  7.    ClientWidth     =   2208
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   2040
  12.    ScaleWidth      =   2208
  13.    Begin VB.TextBox txtStepSize 
  14.       Height          =   285
  15.       Left            =   1080
  16.       TabIndex        =   5
  17.       Text            =   "0.2"
  18.       Top             =   480
  19.       Width           =   855
  20.    End
  21.    Begin VB.TextBox txtFinalMSE 
  22.       Height          =   285
  23.       Left            =   1080
  24.       TabIndex        =   3
  25.       Top             =   1560
  26.       Width           =   855
  27.    End
  28.    Begin VB.CommandButton cmdTrain 
  29.       Caption         =   "Train"
  30.       Height          =   375
  31.       Left            =   240
  32.       TabIndex        =   2
  33.       Top             =   960
  34.       Width           =   1695
  35.    End
  36.    Begin VB.TextBox txtEpochs 
  37.       Height          =   285
  38.       Left            =   1080
  39.       TabIndex        =   0
  40.       Text            =   "500"
  41.       Top             =   120
  42.       Width           =   855
  43.    End
  44.    Begin VB.Label lblStepSize 
  45.       Caption         =   "Step Size:"
  46.       Height          =   315
  47.       Left            =   120
  48.       TabIndex        =   6
  49.       Top             =   480
  50.       Width           =   870
  51.    End
  52.    Begin VB.Label lblFinalMSE 
  53.       Caption         =   "Final MSE:"
  54.       Height          =   315
  55.       Left            =   120
  56.       TabIndex        =   4
  57.       Top             =   1560
  58.       Width           =   870
  59.    End
  60.    Begin VB.Label lblEpochs 
  61.       Caption         =   "Epochs:"
  62.       Height          =   315
  63.       Left            =   240
  64.       TabIndex        =   1
  65.       Top             =   120
  66.       Width           =   870
  67.    End
  68. Attribute VB_Name = "frmTrain"
  69. Attribute VB_GlobalNameSpace = False
  70. Attribute VB_Creatable = False
  71. Attribute VB_PredeclaredId = True
  72. Attribute VB_Exposed = False
  73. Private Sub cmdTrain_Click()
  74.     Dim NSApp As Object
  75.     Dim NSBB As Object
  76.     Dim mseArray As Variant
  77.     Dim finalMSE As Single
  78.     Dim numberOfEpochs As Integer
  79.         
  80.     Set NSApp = CreateObject("NeuroSolutions.Application")
  81.     Set NSBB = NSApp.activeBreadboard
  82.     NSApp.maximize
  83.     numberOfEpochs = txtEpochs.Text
  84.     NSBB.send "control. setEpochs ( 500 )"
  85.     NSBB.send "control. setEpochs ( " & numberOfEpochs & " )"
  86.     NSBB.send "dataStorage. setBufferLength ( " & numberOfEpochs & " )"
  87.     NSBB.send "dataStorage. setMessageEvery ( " & numberOfEpochs & " )"
  88.             
  89.     NSBB.Select "hidden1SynapseBackpropGradient", False
  90.     NSBB.Select "hidden1AxonBackpropGradient", True
  91.     NSBB.Select "outputSynapseBackpropGradient", True
  92.     NSBB.Select "outputAxonBackpropGradient", True
  93.     NSBB.send "activeSelection. setStepSize ( " & txtStepSize.Text & " )"
  94.     NSBB.send "activeSelection. setMomentumRate ( 0.800000 )"
  95.     NSBB.send "trainingCostProbe. openEngineWindow (  )"
  96.     NSBB.Select "Null", False
  97.     NSBB.send "control. resetNetwork (  )"
  98.     NSBB.send "control. runNetwork (  )"
  99.     mseArray = NSBB.send("dataStorage.getProbeData()")
  100.     finalMSE = mseArray(numberOfEpochs - 1, 0)
  101.     txtFinalMSE.Text = Format(finalMSE, "0.00000")
  102. End Sub
  103. Private Sub Label1_Click()
  104. End Sub
  105.